<!DOCTYPE html>
<html>

<head>
<title>打开页面中</title>
</head>

<body>
<p>跳转页面中......</p>
</body>

</html>

<script>
    window.onload = function () {

        var param_bookId = "";
		var param_chapterId="";
        if (window.location.href.indexOf("?") > -1) {
            param_bookId = GetQueryString("bookId");
			param_chapterId =GetQueryString("chapterId");
        }

        var bookId = param_bookId ? param_bookId : "1015358161";
		var chapterId = param_chapterId ? param_chapterId : "468666791";
        
        var actionUrl = 'QDReader://app/openBook?query={"bookId":' + bookId + '}';

		if(/(iPhone|iPad|iPod|iOS|Android|webOS|BlackBerry)/i.test(navigator.userAgent))
		{
			callAPP(actionUrl);
		}
		else
		{
			location.href="https://read.qidian.com/chapter/"+bookId+"/"+chapterId;
		}

        
    }


    function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return decodeURI(r[2]);
        return null;
    }

    function callAPP(t, e) {
        var n = 1; 0 === e && (n = 0);
        var r = /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent) ? "https://itunes.apple.com/cn/app/qi-dian-du-shu-li-xian-ban/id534174796?mt=8"
            : "https://download.qidian.com/apknew/source/weixintuiguang.apk";
        n || (r = "https://acts.qidian.com/2017/5813823/");
        var o = "QDReader/app/openBookshelf";
        if (t && (0 <= t.indexOf("qdreader://") ? o = t.replace("qdreader://", "QDReader/")
            : 0 <= t.indexOf("QDReader://") && (o = t.replace("QDReader://", "QDReader/")), -1 < o.indexOf("?"))) {
            var i = o.split("?");
            if (2 === i.length) {
                var a = i[0], c = i[1].split("&");
                if (0 < c.length) { a += "?"; for (var u = 0, s = c.length; u < s; u++) { var l = c[u].split("="); 2 === l.length && (0 < u && (a += "&"), a += l[0] + "=" + encodeURIComponent(l[1])) } } o = a
            }
        }
        var url = "https://qidian.gtimg.com/" + o + (-1 < o.indexOf("?") ? "&" : "?") + "redirect=" + encodeURIComponent(r);

        location.href = url;
        
    }
</script>
